package com.itheima.dateDemo;

import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Period;

public class LocalDateTimeDemo10 {
    public static void main(String[] args) {
        LocalDateTime nowLocalDateTime = LocalDateTime.now();

        LocalDateTime newLocalDateTime = LocalDateTime.of(2021, 05, 9, 00, 00, 00);

        Duration between = Duration.between(nowLocalDateTime, newLocalDateTime);

        System.out.println(between);

        System.out.println(between.toMillis());

        System.out.println(between.toSeconds());

        System.out.println(between.toNanos());

    }
}
